#include<bits/stdc++.h>
using namespace std;

void allToLarger(string &s) {
	for (auto &ii : s) {
		if ('a' <= ii && ii <= 'z') {
			ii = ii - 'a' + 'A';
		}
	}
}

signed main() {
	string word, s;
	cin >> word;
	getchar();
	getline(cin, s);
	allToLarger(word);
	allToLarger(s);

	int first_index = -1;
	int cnt = 0, index, find_begin = 0;

	while (1) {
		index = s.find(word, find_begin);

		if (index == -1)	break;

		if (
		    (index == 0 || s[index - 1] == ' ')
		    &&
		    (index + word.size() == s.size() || s[index + word.size()] == ' ')
		) {
			cnt++;

			if (first_index == -1)
				first_index = index;
		}
		find_begin = index + word.size();
	}

	if (!cnt)
		cout << -1;
	else
		cout << cnt << " " << first_index;
	return 0;
}
